﻿@model Himall.Web.Areas.Web.Models.ShopHomeModel
@{
    ViewBag.Title = ViewBag.Keyword + "  商品搜索";
    Layout = "~/Areas/Web/Views/Shared/ShopLayout.cshtml";
}

<div class="shop-right">
	@if (Model.Products == null || Model.Products.Count() == 0)
    {

    <div class="shop-goods-list">
        <strong class="list-title"><b>@(ViewBag.Keyword == string.Empty ? ViewBag.CategoryName : ViewBag.Keyword)</b> 找到 @Model.Products.Count()件相关商品</strong>
        

            <div class="notice-search" style="height:200px;padding-top:110px;padding-left:360px;">
                <span class="ns-icon"></span>
                <div class="ns-content">
                    <span>抱歉，没有找到与“<em>@(ViewBag.Keyword == string.Empty ? ViewBag.CategoryName : ViewBag.Keyword)</em>”相关的商品</span>
                </div>
            </div>
			
        

        
    </div>
	<div class="footmark" style="margin-top:20px;">
			<div class="m recent-view">
				<div class="mt">
					<h2 class="title">最近浏览</h2>
				</div>
				<div class="mc">
					<ul class="recent-view-list clearfix">
						@if (null != ViewBag.BrowsedHistory)
						{
							foreach (var item in ((List<Himall.Web.Areas.Web.Models.ProductBrowsedHistoryModel>)ViewBag.BrowsedHistory).Take(10))
							{
								if (item != null)
								{
									<li>
										<div class="p-img center">
											<a href="@Url.Action("Detail", "Product", new { id = item.ProductId })" title="" target="_blank">
												<img class="lazyload" src="~/Areas/Web/images/blank.gif" data-url="@item.ImagePath/1_100.png" alt="" />
											</a>
										</div>
										<div class="p-price center">￥@item.ProductPrice.ToString("f2")</div>
									</li>
								}
							}
						}
					</ul>
				</div>
			</div>
		</div>
	}
	else
	{
	<div class="shop-goods-list">
        <strong class="list-title"><b>@(ViewBag.Keyword == string.Empty ? ViewBag.CategoryName : ViewBag.Keyword)</b> 找到 @Model.Products.Count()件相关商品</strong>
		<ul class="cl">
			@foreach (var p in Model.Products)
			{

				<li>
					<a target="_blank" href="@Url.Action("Detail", "Product", new { id = p.Id })">
						<img class="lazyload" src="~/Areas/Web/images/blank.gif" data-url="@p.ImagePath/1_220.png" alt="" />
					</a>
					<h3>
						<a target="_blank" href="@Url.Action("Detail", "Product", new { id = p.Id })">
							@if (!string.IsNullOrWhiteSpace(ViewBag.Keyword))
							{
								@MvcHtmlString.Create(p.ProductName.Replace((string)ViewBag.Keyword, "<font class='keycolor'>" + (string)ViewBag.Keyword + "</font>"));
							}
							else
							{
								@p.ProductName
							}
						</a>
					</h3>
					<p><span>￥@p.MinSalePrice.ToString("f2")</span></p>
					<p>已售<b>@(p.SaleCounts)</b>件</p>
				</li>
			}

		</ul>
		
	</div>
	<div class="m clearfix" id="bottom_pager">
		<div id="pagin-btm" class="pagin-sm fr">
			@Html.PageLinks((PagingInfo)ViewBag.pageInfo, x => Url.Action("Search", new { pageNo = x, keywords = ViewBag.Keyword, cid = ViewBag.cid, sid = Model.Shop.Id }))
		</div>
	</div>
	}
</div>
